﻿@using ECGadmin.WebUI.CustomHelpers
@using ECGadmin.WebUI.Models
@model ECGadmin.Common.GoldenTimeCampainDto
@{
    ViewBag.Title = "GoldenTime add";
    Layout = "~/Views/Shared/_layout.cshtml";
}
<link href="~/Scripts/jQueryDatePicker/css/ui-lightness/jquery-ui-1.10.1.custom.min.css" rel="stylesheet" />
<link href="~/Scripts/jQueryDatePicker/js/jquery-ui-timepicker-addon.css" rel="stylesheet" />
<nav>
    <div id="jCrumbs" class="breadCrumb module">
        <ul>
            <li><a href="@Url.Action("Index", "Home")"><i class="bootstrap icon-home"></i></a></li>
            <li><a href="javascript:void(0)">Sản phẩm</a> </li>
            <li><a href="@Url.Action("Index", "GoldenTime")">Danh sách giờ vàng</a> </li>
            <li><a href="@Url.Action("Add", "GoldenTime")">Thêm chiến dịch</a> </li>
        </ul>
    </div>
</nav>
<div class="toolBox">
    @Html.ToolBox(new List<object> { new Save { ClassCss = "Save", ActionName = "Javascript:void(0)" }, new Back { ClassCss = "Back", ActionName = @Url.Action("Index", "GoldenTime") } })
</div>
<div class="box-Info">
    @using (Html.BeginForm("Add", "GoldenTime", FormMethod.Post, new { enctype = "multipart/form-data", id = "AddGoldenTimeCampain" }))
    {
        <table cellspacing="0" cellpadding="0" border="0" width="100%" class="table-info">
            <tr>
                <td class="tInfoLeft">Tên chiến dịch:
                </td>
                <td class="tInfoRight">
                    @* <input type="text" name="txtCamName" style="width: 400px;" />*@
                    @Html.TextBoxFor(m => m.CampainName)
                    @Html.ValidationMessageFor(m => m.CampainName)
                </td>
            </tr>
            <tr>
                <td class="tInfoLeft">Ngày bắt đầu:
                </td>
                <td class="tInfoRight">
                    @Html.TextBoxFor(m => m.DateBegin, new { @class = "cssInputWidthSmall", data_val = false })
                </td>
            </tr>
            <tr>
                <td class="tInfoLeft">Ngày kết thúc:
                </td>
                <td class="tInfoRight">
                    @Html.TextBoxFor(m => m.DateEnd, new { @class = "cssInputWidthSmall", data_val = false })
                </td>
            </tr>
            <tr>
                <td class="tInfoLeft">Hiển thị sp theo: 
                </td>
                <td class="tInfoRight">
                    @Html.RadioButtonFor(m => m.Random, true, new { @checked = "checked" }) <span>Thứ tự</span>
                    @Html.RadioButtonFor(m => m.Random, false) <span>Random</span>
                </td>
            </tr>
            <tr>
                <td class="tInfoLeft">Trạng thái:
                </td>
                <td class="tInfoRight">
                    @Html.DropDownListFor(m => m.Status, new SelectList((List<object>)ViewBag.GoldenTimeStatus, "ItemValue", "ItemText"))
                </td>
            </tr>
        </table>
    }
</div>
@section scripts
{
    <script src="~/Scripts/jquery.validate.min.js"></script>
    <script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
    <script src="~/Scripts/jQueryDatePicker/js/jquery-ui-1.10.1.custom.min.js"></script>
    <script src="~/Scripts/jQueryDatePicker/js/jquery-ui-timepicker-addon.js"></script>

    <script>
        // button submit
        $('ul li.Save a').click(function () {
            $('form#AddGoldenTimeCampain').submit();
        });
        
        // Date picker
        $('#DateBegin').datetimepicker({ dateFormat: 'dd/mm/yy', timeFormat: "hh:mm:ss tt" });
        $('#DateEnd').datetimepicker({ dateFormat: 'dd/mm/yy', timeFormat: "hh:mm:ss tt" });
    </script>
}